<?php
declare (strict_types=1);
namespace app\validate;

use think\Validate;

/**
 * 系统部门
 * Class SysDept
 * @package app\validate
 * @date 2019-11-27
 */
class SysDept extends Validate
{
    //验证规则
    protected $rule = [
        'deptName'   => 'require',
        'deptId'      => 'require|number',
        'sortNo'     => 'require|number',
    ];

    //提示信息
    protected $message = [
        'deptId.number'    => '开发部ID必须是数字',
        'deptId.require'        => '开发部ID必须',
        'deptName'   =>    '请输入开发部名称',
        'sortNo.require'     => '请输入排序号',
        'sortNo.number'      => '部门编号只能为数字',
    ];

    //验证场景
    protected $scene = [
        'save' => ['deptName','sortNo'],
        'delete' => ['deptId'],
    ];

}
